<?php
namespace app\api\controller\fumin;

class Weixin extends Base {
    public function index() {
        date_default_timezone_set('Asia/Shanghai');
        $outNo = 'CY' . date('YmdHis', time()) . rand(10, 99);
        $this->assign('timestamp', time());
        $this->assign('outNo', $outNo);
        return $this->fetch();
    }
    
    // 下单接口
    public function order() {
        $data = input('post.');
        $data['mchntId'] =  $this->C('merchant_id');
        $data['signature'] = $this->createSign($data); // 创建签名
        $result = $this->curl($this->C('orderUrl'), $data);
        return $result;
    }
}
